import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from 'src/common/entities/base';
import { ApiProperty } from '@nestjs/swagger';

@Entity('edu_course', {
  comment: '课程表',
})
export class CourseEntity extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'course_id', comment: '课程ID' })
  public courseId: number;

  @ApiProperty({ description: '课程名称' })
  @Column({ type: 'varchar', name: 'course_name', length: 32, comment: '课程名称' })
  public courseName: string;

  @ApiProperty({ description: '课程介绍' })
  @Column({ type: 'varchar', name: 'course_introduce', length:255, comment: '课程介绍' })
  public courseIntroduce: string;

  @ApiProperty({ description: '课程时长' })
  @Column({ type: 'int', name: 'course_time',comment: '课程时长' })
  public courseTime: number;
}
